﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Compilation;
using System.CodeDom;
using System.Web.UI;

namespace legacy
{
    [System.Web.Compilation.ExpressionPrefix("Code")]
	public class CodeExpressionBuilder : ExpressionBuilder
	{
		public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
		{
			return new CodeSnippetExpression(entry.Expression);
		}
	}

    [System.Web.Compilation.ExpressionPrefix("DictionaryItem")]
    public class DictionaryEntryExpressionBuilder : ExpressionBuilder
    {
        public override CodeExpression GetCodeExpression(BoundPropertyEntry entry, object parsedData, ExpressionBuilderContext context)
        {
            return new CodeSnippetExpression(string.Format("umbraco.library.GetDictionaryItem(\"{0}\")",entry.Expression));
        }
    }

}
